package com.goldcn.order.dao;

import com.goldcn.order.dto.SettlementConditionDto;
import com.goldcn.order.dto.SettlementForCountDto;
import com.goldcn.order.model.OrderSettlement;
import com.goldcn.order.vo.SettlementCountVo;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

public interface OrderSettlementMapper {
    int deleteByPrimaryKey(Long id);

    int insert(OrderSettlement record);

    int insertSelective(OrderSettlement record);

    OrderSettlement selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(OrderSettlement record);

    int updateByPrimaryKey(OrderSettlement record);

    List<OrderSettlement> selectByYearMonth(Map<String,Object> param);

    int insertBatch(List<OrderSettlement> params);

    List<OrderSettlement> selectByConditon(SettlementConditionDto settlement);

    int updateState(Map params);

    BigDecimal settlementTotal(@Param("sellerID") Long sellerID,@Param(value = "companyID") Long companyID);

    BigDecimal selectTotalCommission(@Param("branchID") Long branchID,@Param(value = "companyID") Long companyID);

    SettlementCountVo selectSettlementCount(SettlementForCountDto countDto);

    List<Map<String,Integer>> selectDistinctByState(@Param("type")String type,@Param(value = "companyID") Long companyID);

    int deleteByMonthRecord(@Param("year")Integer year,@Param("month")Integer month);
}